// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 注册
import register from '@/views/register';
// 首页
import index from '@/views/index';
// 商城
import shopping from '@/views/shopping';
// 详情
import details from '@/views/details';
/**
 * 基础菜单
 */
// 商品管理
import Goods from '@/views/goods/Goods';
// 类别管理
import AddGoods from '@/views/AddGoods/AddGoods';
// 查询书籍
import QueryGoods from '@/views/queryGoods/queryGoods';
// 借阅管理
import Borrowing from '@/views/Administration/Borrowing'
// 账号管理
import User from '@/views/Administration/User'
// 我的评论
import CommitMy from '@/views/Administration/CommitMy'
/**
 * 数据监控
 */
// 监控查询
import druidLogin from '@/views/druid/login';

// 图表界面
import statistics from '@/views/charts/statistics';

// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    routes: [{
        path: '/',
        name: '',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/shopping',
        name: '商城',
        component: shopping,
        hidden: true,
        meta: {
            requireAuth: true
        }
    }, {
        path: '/details',
        name: '详情',
        component: details,
        hidden: true,
        meta: {
            requireAuth: true
        }
    },
    {
        path: '/register',
        name: '注册',
        component: register,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/index',
        name: '首页',
        component: index,
        iconCls: 'el-icon-tickets',
        children: [{
            path: '/goods/Goods',
            name: '录入新书',
            component: Goods,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/AddGoods/AddGoods',
            name: '类别管理',
            component: AddGoods,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/queryGoods/queryGoods',
            name: '查询书籍',
            component: QueryGoods,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/Administration/Borrowing',
            name: '借阅管理',
            component: Borrowing,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/Administration/User',
            name: '账号管理',
            component: User,
            meta: {
                requireAuth: true
            }
        },
        {
            path: '/Administration/CommitMy',
            name: '我的评论',
            component: CommitMy,
            meta: {
                requireAuth: true
            }
        },
        ]
    }]
})